package com.thb.pay.manage.web.order;

import com.thb.pay.api.order.MchTradeOrderServiceApi;
import com.thb.pay.api.order.vo.req.MchTradeOrderPageReq;
import com.thb.pay.api.order.vo.req.MchTradeOrderReq;
import com.thb.pay.core.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 功能描述:
 * @auther: huanglc
 * @date: 2019-10-23 18:14
 */
@RestController
@RequestMapping("/api/sys/mchTradeOrder")
public class MchTradeOrderController {

    @Autowired
    private MchTradeOrderServiceApi mchTradeOrderServiceApi;

    @PostMapping("/list")
    public R list(@RequestBody MchTradeOrderPageReq pageReq) {
        return R.okData(mchTradeOrderServiceApi.findPage(pageReq));
    }

    @RequestMapping("/get")
    public R get(@RequestParam("id") Long id) {
        return R.okData(mchTradeOrderServiceApi.getById(id));
    }

    @PostMapping("/count")
    public R count(@RequestBody MchTradeOrderReq req) {
        return R.okData(mchTradeOrderServiceApi.count(req));
    }
}
